package com.joker.springcloud.service;

import com.joker.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Author JokerKS
 * @Date 2021/12/21 16:30
 * @Version 1.0
 */

@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",
		fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {

	@PostMapping("/dept/add")
	boolean addDept(Dept dept);

	@GetMapping("/dept/get/{id}")
	Dept queryById(@PathVariable("id") Long id);

	@GetMapping("/dept/list")
	List<Dept> queryAll();
}
